home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utilwb / vark13.lha / Vark / Lottery / lottery.e < prev    next >
Text File  |  1994-12-10  |  1KB  |  39 lines

  1. /* Lottery.e v1.1 (10/12/94) ©1994 Michael Askin */
  2.  
  3. MODULE 'DOS/DOS'
  4.  
  5. PROC main()
  6.    DEF r,ds : datestamp,i, array[50]:ARRAY OF LONG, j, pos
  7.    DEF numbers[7]:ARRAY OF LONG, n
  8.  
  9.    /* Version String */
  10.    WriteF('\s\n','$VER: Lottery 1.1 (10.12.94) ©1994 Michael Askin'+6)
  11.  
  12.    DateStamp(ds)
  13.    FOR i:=0 TO ds.tick DO Rnd(100)
  14.  
  15.    /* Setup balls! The numbers in the array only need to be non-zero */
  16.    /* rather than individual numbers.                                */
  17.    FOR i:=1 TO 49
  18.       array[i]:=i
  19.    ENDFOR
  20.  
  21.    /* Pick one at random, if picked already (array[x]=0) then try again */
  22.    /* and do it 6 times                                                 */
  23.    FOR i:=0 TO 5
  24.       WHILE array[(pos:=Rnd(48)+1)]=0
  25.          IF CtrlC()=TRUE THEN CleanUp(0)
  26.       ENDWHILE
  27.       /* Mark it as read */
  28.       array[pos]:=0
  29.    ENDFOR
  30.    /* Now read the numbers marked in numerical order */
  31.    WriteF('Your numbers are : ')
  32.    FOR i:=1 TO 49
  33.       IF array[i]=0 THEN WriteF('\d ',i)
  34.    ENDFOR
  35.    WriteF('\n')
  36. ENDPROC
  37.  
  38.  
  39.